<?php
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $clothes = $_POST["clothes"];
    if (!in_array($clothes, $_SESSION['current_clothes'])) {
        $_SESSION['current_clothes'][] = $clothes;
    }
    header('Content-Type: application/json');
    echo json_encode($_SESSION['current_clothes']);
}
?>